In [1]:
%pylab inline
In [2]:
agev = np.array([0.075e9, 0.575e9 ,1.5e9, 2.5e9, 4e9, 6e9, 8.5e9])
dagev = np.array([0.075e9, 0.425e9, 0.5e9, 0.5e9, 1e9, 1e9, 1.5e9])
In [3]:
age = (1e10-agev)/1e9
dage = dagev/1e9
In [4]:
time = age
In [5]:
def sfr(time):
return(np.exp(-0.12*time))
In [6]:
plt.plot(time,sfr(time))
Out[6]:
In [7]:
sfrv = sfr(time)
In [8]:
sfrv
Out[8]:
In [9]:
time
Out[9]:
In [10]:
dage
Out[10]:
In [11]:
sumsfr = dage*sfrv*2
print(sumsfr)
In [12]:
old_sfr = 2.37*7
sum(sumsfr)
Out[12]:
In [13]:
old_sfr/(sum(sumsfr))
Out[13]:
In [14]:
new_sfr = sumsfr*(old_sfr/sum(sumsfr))
In [15]:
new_sfr
Out[15]:
In [16]:
agev
Out[16]:
This vector assumes that weighting with dage is not happening in Galaxia.
In [17]:
new_sfr = sfrv*(old_sfr/sum(sfrv))
In [18]:
new_sfr
Out[18]:
This vector assumes that weighting with dage is done in Galaxia
In [21]:
sum(dage*new_sfr)
Out[21]:
In [22]:
2.37*7
Out[22]:
In [23]:
sum(new_sfr)
Out[23]:
In [ ]: